package com.woniuxueyuan.Producer;

import com.woniuxueyuan.util.RabbitmqConst;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class TopicProducer {
    @Resource
    private RabbitTemplate rabbitTemplate;
    public void send(String routekey,String msg){
        rabbitTemplate.convertAndSend(RabbitmqConst.TOPIC_EXCHANGE,routekey,msg);
    }
}
